 import React, { useEffect, useState } from "react";
import {
  Form,
  Input,
  Button,
  Dialog,
  Checkbox,
  Space,
  DatePicker,
  Toast,
} from "antd-mobile";
import { FormInstance } from "antd-mobile/es/components/form";
import dayjs from "dayjs";
import { CloseCircleFill } from "antd-mobile-icons";
import { useNavigate } from "react-router-dom";
import Yzmlogin from '../../components/Yzmlogin'
import Mmlogin from '../../components/Mmlogin'
import "./index.css";
import axios from "axios";
const Index: React.FC = () => {
  const navigate = useNavigate();
  const nav=['验证码登录',"密码登录"]
  const [loginIndex, setLoginIndex] = useState(0);

  return (
    <div className="login">
      <div className="login-top">
        <img src="https://zhengxin-pub.cdn.bcebos.com/financepic/0dcef1c36477d3f197ff3c46f6e530c9_fullsize.jpg" />
      </div>
      <div className="login-zhong">
        <h3>微脉</h3>
      </div>
      <div className="login-bottom">
         <div className="login-bottom-1">
           {nav.map((item,index)=>{
            return <div onClick={()=>setLoginIndex(index)}className={index==loginIndex ? 'activelogin':''}>{item}</div>
           })}
         </div>
         <div className="login-bottom-2">
         {loginIndex===0?<div><Yzmlogin/></div>:<div><Mmlogin/></div>}
          
         </div>
      </div>
    </div>
  );
};

export default Index;
